import Image from 'next/image'
import vercel from '@/public/vercel.svg'

export function ShowLevelImg({ level }: { level: number }) {
  let url: string = ''
  switch (level) {
    case 3:
      url =
        '//lf3-cdn-tos.bytescm.com/obj/static/xitu_juejin_web/65a6a28f15d70e5a77bf881c5ec5340d.svg'
      break
    case 4:
      url =
        '//lf3-cdn-tos.bytescm.com/obj/static/xitu_juejin_web/8c6985e2aa4c06f307ae3734da4b43ac.svg'
      break
    case 5:
      url =
        '//lf3-cdn-tos.bytescm.com/obj/static/xitu_juejin_web/cf19b122213ebdbd25b66f02500b8c27.svg'
      break
    case 6:
      url =
        '//lf3-cdn-tos.bytescm.com/obj/static/xitu_juejin_web/70f1e5e3a2fde62e0d623009ab80cb12.svg'
      break
    default:
      url = ''
      break
  }
  if (!url) return null
  return (
    <Image
      className='px-1 inline-block'
      loader={() => url}
      alt={`创作等级 ${level}`}
      src={vercel}
      width={35}
    />
  )
}

export function ShowVipImg({ level }: { level: number }) {
  if (level)
    return (
      <Image
        className='px-1 inline-block'
        loader={() =>
          '//lf3-cdn-tos.bytescm.com/obj/static/xitu_juejin_web/24127194d5b158d7eaf8f09a256c5d01.svg'
        }
        alt='会员'
        src={vercel}
        width={22}
      />
    )
  return null
}

export function ShowCreativeImg({ level }: { level: number }) {
  let url = ''
  switch (level) {
    case 2:
      url =
        'https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ad1d5b8ec0974b0bbc14446acdd7c20d~tplv-k3u1fbpfcp-no-mark:0:0:0:0.awebp'
      break
    case 3:
      url =
        'https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/a3f5a3e7550645a08184e5c4247cc3d4~tplv-k3u1fbpfcp-no-mark:0:0:0:0.awebp'
      break
    case 4:
      url =
        'https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/05be64d75fee4dbdb290ba23afd21fcf~tplv-k3u1fbpfcp-no-mark:0:0:0:0.awebp'
      break
    case 5:
      url =
        'https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/2fa3f08a7107485f81157b296fd9d41f~tplv-k3u1fbpfcp-no-mark:0:0:0:0.awebp'
      break
    case 6:
      url =
        'https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/06b49284428a4dc48be678a47cd1504b~tplv-k3u1fbpfcp-no-mark:0:0:0:0.awebp'
      break
    default:
      url = ''
      break
  }
  if (!url) return null
  return (
    <Image
      className='px-1 inline-block'
      loader={() => url}
      alt={`创作等级 ${level}`}
      src={vercel}
      width={35}
    />
  )
}
